package com.he.DesignPatterns.Responsibility;

import java.text.MessageFormat;

/**
 * @description: 小组长类
 * @Author: HCL
 * @Date: 2024/9/4 9:27
 */
public class GroupLeader extends Handler {

    public GroupLeader() {
        super(0, Handler.NUM_ONE);
    }

    @Override
    protected void handleLeave(LeaveRequest leaveRequest) {
        System.out.println(MessageFormat.format("{0}请假{1}天,{2}",
                leaveRequest.getName(), leaveRequest.getNum(), leaveRequest.getContent()));
        if (leaveRequest.getNum() > Handler.NUM_ONE){
            System.out.println("请假天数超过小组长审批限制,请部门经理审批");
        }else{
            System.out.println("小组长审批：同意");
        }
    }
}
